<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录页面</title>
</head>
<body>
    <c:if test="${ not empty sessionScope.user}">
        <p>欢迎${sessionScope.user.username}</p>
        <p>
            <a href="${pageContext.request.contextPath}/user/logout">退出</a>
        </p>
    </c:if>
    <c:if test="${ empty sessionScope.user }">
        <form action="${pageContext.request.contextPath}/user/login" method="post">
            <input type="text" name="username" placeholder="登录名称">
            <input type="password" name="password" placeholder="登录密码">
            <button type="submit">登录</button>
        </form>
    </c:if>
</body>
</html>
